#include "XCompareParam.h"
#include <QDebug>
XCompareParam * XCompareParam::m_p = new XCompareParam();


XCompareParam::XCompareParam()
{
}

XCompareParam::~XCompareParam()
{
}

void XCompareParam::setParam(QString left, QString right)
{
	QMutexLocker m(&m_mutex);
	qDebug() << "===" << left << right;

	if (left == "D:/EU4 1.33.3/1.33.3/eu4_chinese/gfx/fonts")
	{
		static int hx = 0;
		if (hx == 1)
		{
			hx++;
		}
		hx++;
	}
	m_param.push_back(QPair<QString, QString>(left, right));
}

QPair<QString, QString> XCompareParam::getParam()
{
	QMutexLocker m(&m_mutex);
	if (m_param.length() > 0)
	{
		auto p = m_param.first();
		m_param.pop_front();
		return p;
	}
	return QPair<QString, QString>();
}

XCompareParam * XCompareParam::Instance()
{
	return m_p;
}

void XCompareParam::Release()
{
	if (m_p)
	{
		delete m_p;
	}
}


